package com.feishi.core.socket.common.lifecycle;

import com.feishi.core.analytic.assembler.BaseAssembler;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by caixq on 5/14 014.
 */
public class SocketRequest<T extends BaseAssembler> {

    private SocketSession<T> session;
    private Map<String,Object> data=new HashMap<>();

    public SocketRequest(SocketSession<T> session) {
        this.session=session;
    }

    public void setAttribute(String name,Object value){
        data.put(name,value);
    }
    public Object getAttribute(String name){
        return data.get(name);
    }
    public void clearAttribute(){
        this.data.clear();
    }
    public SocketSession<T> getSession(){
        return this.session;
    }
    public SocketApplication<T> getApplication(){
        return this.session.getApplication();
    }
}
